package ttsolver.constraints;

public abstract class DefaultConstraint implements Constraint
{
   protected final ConstraintType type;
   protected final Boolean printCons;

   public DefaultConstraint(ConstraintType type)
   {
      this.type = type;
      this.printCons = true;
   }

   public ConstraintType getType()
   {
      return type;
   }

   public Boolean getPrintCons()
   {
      return printCons;
   }

   @Override
   public int hashCode()
   {
      final int prime = 31;
      int result = 1;
      result = prime * result + ((type == null) ? 0 : type.hashCode());
      return result;
   }

   @Override
   public boolean equals(Object obj)
   {
      if (this == obj)
         return true;
      if (obj == null)
         return false;
      if (getClass() != obj.getClass())
         return false;
      DefaultConstraint other = (DefaultConstraint) obj;
      if (type != other.type)
         return false;
      return true;
   }

}
